import request from '@/request/index'

export function getArticles(page) {
    return request({
        method: 'post',
        url: '/articles/findArticlePage',
        data: page
    })
}

export function getNewArticles() {
    return request({
        url: '/articles/hot',
        method: 'post'
    })
}

export function getHotArticles() {
    return request({
        url: '/articles/new',
        method: 'post'
    })
}

export function getArchives() {
    return request({
        url: '/articles/listArchives',
        method: 'post'
    })
}

export function viewArticle(id) {
    return request({
        url: `/articles/view/${id}`,
        method: 'post'
    })
}

export function getArticleById(id) {
    return request({
        url: `/articles/${id}`,
        method: 'post'
    })
}